
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>负载均衡 · tgor note</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="tgor">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../运维/Nginx负载均衡.html" />
    
    
    <link rel="prev" href="../运维/Nginx限流.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Me
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../category/微服务.html">
            
                <a href="../category/微服务.html">
            
                    
                    微服务
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="Feign.html">
            
                <a href="Feign.html">
            
                    
                    HTTP客户端Feign
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../Java-其他库/限流.html">
            
                <a href="../Java-其他库/限流.html">
            
                    
                    限流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../运维/Nginx限流.html">
            
                <a href="../运维/Nginx限流.html">
            
                    
                    限流Nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.4" data-path="负载均衡.html">
            
                <a href="负载均衡.html">
            
                    
                    负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../运维/Nginx负载均衡.html">
            
                <a href="../运维/Nginx负载均衡.html">
            
                    
                    负载均衡Nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../Java-其他库/熔断Hystrix.html">
            
                <a href="../Java-其他库/熔断Hystrix.html">
            
                    
                    熔断Hystrix
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="../Java-其他库/缓存.html">
            
                <a href="../Java-其他库/缓存.html">
            
                    
                    缓存
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="../Java-其他库/缓存.html">
            
                <a href="../Java-其他库/缓存.html#本地缓存">
            
                    
                    本地缓存
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="../Redis/Redis.html">
            
                <a href="../Redis/Redis.html">
            
                    
                    分布式缓存Redis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10" data-path="../Java-其他库/分布式事务.html">
            
                <a href="../Java-其他库/分布式事务.html">
            
                    
                    分布式事务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.11" data-path="../Java-其他库/分布式事务.html">
            
                <a href="../Java-其他库/分布式事务.html#事务消息">
            
                    
                    可靠事务消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.12" data-path="业务监控.html">
            
                <a href="业务监控.html">
            
                    
                    业务监控
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.13" data-path="../Java-其他库/分布式定时作业.html">
            
                <a href="../Java-其他库/分布式定时作业.html">
            
                    
                    分布式作业调度ElasticJob
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.14" data-path="../Java-ORM/ORM.html">
            
                <a href="../Java-ORM/ORM.html">
            
                    
                    ORM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.15" data-path="../Java-其他库/分布式系统及CAP原理.html">
            
                <a href="../Java-其他库/分布式系统及CAP原理.html">
            
                    
                    分布式系统及CAP原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.16" data-path="../MQ/RabbitMQ笔记.html">
            
                <a href="../MQ/RabbitMQ笔记.html">
            
                    
                    消息驱动Rabbitmq
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../category/数据库.html">
            
                <a href="../category/数据库.html">
            
                    
                    数据库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../Mysql/经典数据库设计案例.html">
            
                <a href="../Mysql/经典数据库设计案例.html">
            
                    
                    mysql设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../Mysql/Mysql事务与锁.html">
            
                <a href="../Mysql/Mysql事务与锁.html">
            
                    
                    mysql事务与锁
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../Mysql/mysql数据类型.html">
            
                <a href="../Mysql/mysql数据类型.html">
            
                    
                    mysql数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../Mysql/mysql索引及查询.html">
            
                <a href="../Mysql/mysql索引及查询.html">
            
                    
                    mysql索引与查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../Mysql/mysql索引及查询.html">
            
                <a href="../Mysql/mysql索引及查询.html#查询语句设计准则">
            
                    
                    mysql查询语句设计准则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../Mysql/mysql性能测试.html">
            
                <a href="../Mysql/mysql性能测试.html">
            
                    
                    mysql性能测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../Mysql/mysql主从同步与读写分离.html">
            
                <a href="../Mysql/mysql主从同步与读写分离.html">
            
                    
                    mysql主从同步与读写分离
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="SpringBoot事务注解@Transactional.html">
            
                <a href="SpringBoot事务注解@Transactional.html">
            
                    
                    Spring事务注解@Transactional
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="../数据结构与算法/位运算应用实例.html">
            
                <a href="../数据结构与算法/位运算应用实例.html">
            
                    
                    位运算应用实例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="../Mongodb-Client/morphia-API汇总.html">
            
                <a href="../Mongodb-Client/morphia-API汇总.html">
            
                    
                    morphia API汇总
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.11" data-path="../Mongodb-Client/mongo驱动连接.html">
            
                <a href="../Mongodb-Client/mongo驱动连接.html">
            
                    
                    mongodb驱动与连接
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.12" data-path="../Mongodb/mongodb-ObjectId实践.html">
            
                <a href="../Mongodb/mongodb-ObjectId实践.html">
            
                    
                    mongodb ObjectId实践
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.13" data-path="../Mongodb/mongodb角色权限.html">
            
                <a href="../Mongodb/mongodb角色权限.html">
            
                    
                    mongodb角色权限
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../category/java并发.html">
            
                <a href="../category/java并发.html">
            
                    
                    Java并发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../Java-Base/Java并发.html">
            
                <a href="../Java-Base/Java并发.html">
            
                    
                    Java并发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../Java-Base/Java并发.html">
            
                <a href="../Java-Base/Java并发.html#锁">
            
                    
                    Java并发之锁设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../Java-Base/Java并发.html">
            
                <a href="../Java-Base/Java并发.html#synchronized">
            
                    
                    Java并发之synchronized
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../Java-Base/Java之Lock.html">
            
                <a href="../Java-Base/Java之Lock.html#reentrantlock">
            
                    
                    Java Lock之ReentrantLock
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../Java-Base/Java之Lock.html">
            
                <a href="../Java-Base/Java之Lock.html#reentrantreadwritelock">
            
                    
                    Java Lock之ReentrantReadWriteLock
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../Java-Base/Java之Future.html">
            
                <a href="../Java-Base/Java之Future.html">
            
                    
                    Java Future
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../Java-Base/Java之Future.html">
            
                <a href="../Java-Base/Java之Future.html#futuretask">
            
                    
                    Java Future之FutureTask
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="../Java-Base/Java之Future.html">
            
                <a href="../Java-Base/Java之Future.html#completablefuture">
            
                    
                    Java Future之CompletableFuture
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="../Java-Base/Java之Future.html">
            
                <a href="../Java-Base/Java之Future.html#forkjointask">
            
                    
                    Java Future之ForkJoinTask
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.10" data-path="../Java-Base/Java之Thread.html">
            
                <a href="../Java-Base/Java之Thread.html">
            
                    
                    Java Thread
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../category/redis.html">
            
                <a href="../category/redis.html">
            
                    
                    Redis
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../Redis/Redis.html">
            
                <a href="../Redis/Redis.html">
            
                    
                    Redis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../Redis/Redis.html">
            
                <a href="../Redis/Redis.html#集群">
            
                    
                    Redis集群
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../Redis/Redis.html">
            
                <a href="../Redis/Redis.html#消息订阅">
            
                    
                    Redis消息订阅
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../Redis/Redis.html">
            
                <a href="../Redis/Redis.html#lua">
            
                    
                    Redis Lua脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../Redis/Redis.html">
            
                <a href="../Redis/Redis.html#配置汇总">
            
                    
                    Redis配置汇总
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../category/运维.html">
            
                <a href="../category/运维.html">
            
                    
                    运维
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../运维/Linux常用操作汇总.html">
            
                <a href="../运维/Linux常用操作汇总.html">
            
                    
                    Linux常用操作汇总
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../运维/阿里云笔记.html">
            
                <a href="../运维/阿里云笔记.html">
            
                    
                    阿里云笔记
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../category/nginx.html">
            
                <a href="../category/nginx.html">
            
                    
                    Nginx
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../运维/Nginx学习笔记.html">
            
                <a href="../运维/Nginx学习笔记.html">
            
                    
                    Nginx基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../运维/Nginx负载均衡.html">
            
                <a href="../运维/Nginx负载均衡.html">
            
                    
                    Nginx负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../运维/Nginx限流.html">
            
                <a href="../运维/Nginx限流.html">
            
                    
                    Nginx限流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../运维/Nginx学习笔记.html">
            
                <a href="../运维/Nginx学习笔记.html#六、其他">
            
                    
                    Nginx客户端辅助技巧
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../category/容器化.html">
            
                <a href="../category/容器化.html">
            
                    
                    容器化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../Docker/docker笔记.html">
            
                <a href="../Docker/docker笔记.html">
            
                    
                    Docker学习笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../Docker/docker笔记.html">
            
                <a href="../Docker/docker笔记.html#基础操作">
            
                    
                    Docker基础操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../Docker/docker笔记.html">
            
                <a href="../Docker/docker笔记.html#dockerfile">
            
                    
                    DockerFile
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../category/Web.html">
            
                <a href="../category/Web.html">
            
                    
                    Web
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../运维/Http入坑Https笔记.html">
            
                <a href="../运维/Http入坑Https笔记.html">
            
                    
                    Http入坑Https笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../Web/阿里云OSS.html">
            
                <a href="../Web/阿里云OSS.html">
            
                    
                    OSS
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../category/java基础.html">
            
                <a href="../category/java基础.html">
            
                    
                    Java基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../Java-Base/Java基础.html">
            
                <a href="../Java-Base/Java基础.html#jvm">
            
                    
                    JVM基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../Java-Base/Java基础.html">
            
                <a href="../Java-Base/Java基础.html#语法糖">
            
                    
                    Java语法糖
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../Java-Base/Java基础.html">
            
                <a href="../Java-Base/Java基础.html#数据结构">
            
                    
                    Java数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../Java-Base/Java8函数式编程.html">
            
                <a href="../Java-Base/Java8函数式编程.html">
            
                    
                    java8函数式编程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../Java-Base/ArrayList源码分析.html">
            
                <a href="../Java-Base/ArrayList源码分析.html">
            
                    
                    JDK源码分析ArrayList
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.6" data-path="../Java-Base/HashMap源码分析.html">
            
                <a href="../Java-Base/HashMap源码分析.html">
            
                    
                    JDK源码分析HashMap
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.7" data-path="../Java-Base/Java注解.html">
            
                <a href="../Java-Base/Java注解.html">
            
                    
                    Java注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.8" data-path="../Java-Base/Timsort排序算法.html">
            
                <a href="../Java-Base/Timsort排序算法.html">
            
                    
                    Timsort排序算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.9" data-path="../Java-Base/插入排序分析与Java实现.html">
            
                <a href="../Java-Base/插入排序分析与Java实现.html">
            
                    
                    插入排序分析与Java实现
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../category/工具与规范.html">
            
                <a href="../category/工具与规范.html">
            
                    
                    工具与规范
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../工具/Maven使用技巧汇总.html">
            
                <a href="../工具/Maven使用技巧汇总.html">
            
                    
                    Maven使用技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../编码规范/Java编码规范.html">
            
                <a href="../编码规范/Java编码规范.html">
            
                    
                    Java编码规范
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../category/OLAP.html">
            
                <a href="../category/OLAP.html">
            
                    
                    OLAP
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../数据处理/storm学习笔记.html">
            
                <a href="../数据处理/storm学习笔记.html">
            
                    
                    流式计算Storm学习笔记
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../category/数据运营.html">
            
                <a href="../category/数据运营.html">
            
                    
                    数据运营
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../数据运营/增长黑客数据运营.html">
            
                <a href="../数据运营/增长黑客数据运营.html">
            
                    
                    增长黑客-数据运营
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../category/前端技术栈.html">
            
                <a href="../category/前端技术栈.html">
            
                    
                    前端技术栈
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="../前端/JavaScript设计模式.html">
            
                <a href="../前端/JavaScript设计模式.html">
            
                    
                    JavaScript设计模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="../前端/html相对路径与绝对路径.html">
            
                <a href="../前端/html相对路径与绝对路径.html">
            
                    
                    Html相对路径与绝对路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.3" data-path="../前端/微信小程序学习笔记.html">
            
                <a href="../前端/微信小程序学习笔记.html">
            
                    
                    微信小程序学习笔记
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../category/个人.html">
            
                <a href="../category/个人.html">
            
                    
                    个人
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="../个人/简历.html">
            
                <a href="../个人/简历.html">
            
                    
                    简历
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >负载均衡</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x8D1F;&#x8F7D;&#x5747;&#x8861;">&#x8D1F;&#x8F7D;&#x5747;&#x8861;</h1>
<p><a href="../&#x8FD0;&#x7EF4;/Nginx&#x8D1F;&#x8F7D;&#x5747;&#x8861;.html">Nginx&#x8D1F;&#x8F7D;&#x5747;&#x8861;</a></p>
<p><a href="http://naotu.baidu.com/file/129e067eee3d2008acd449daea620fd9?token=e00622f2c44fb850" target="_blank">&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x8111;&#x56FE;</a></p>
<h2 id="&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x7B97;&#x6CD5;">&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x7B97;&#x6CD5;</h2>
<ul>
<li>&#x8F6E;&#x8BE2;RR</li>
<li>&#x52A0;&#x6743;&#x8F6E;&#x8BE2;WRR</li>
<li>&#x54C8;&#x5E0C;Hash</li>
<li>&#x6700;&#x5C11;&#x8FDE;&#x63A5;&#x6570;LC</li>
<li>&#x968F;&#x673A;RD</li>
</ul>
<p>&#x8FDB;&#x9636;&#x7B97;&#x6CD5;</p>
<ul>
<li>&#x52A8;&#x6001;&#x52A0;&#x6743;&#x8F6E;&#x8BE2;</li>
</ul>
<h2 id="&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x5206;&#x7C7B;">&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x5206;&#x7C7B;</h2>
<h3 id="&#x670D;&#x52A1;&#x5668;">&#x670D;&#x52A1;&#x5668;</h3>
<p>&#x53C2;&#x8003;&#x81EA;&#xFF1A;<a href="https://www.cnblogs.com/gucb/p/11237765.html" target="_blank">&#x670D;&#x52A1;&#x7AEF;&#x8D1F;&#x8F7D;&#x5747;&#x8861;</a></p>
<p>&#x670D;&#x52A1;&#x5668;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x5C31;&#x662F;&#x6211;&#x4EEC;&#x5E73;&#x65F6;&#x8BF4;&#x7684;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#xFF0C;&#x662F;&#x6307;&#x5728;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x6E38;&#x505A;&#x670D;&#x52A1;&#x5206;&#x53D1;&#xFF0C;&#x5E38;&#x7528;&#x7684;&#x65B9;&#x5F0F;&#x6709;&#x4E00;&#x4E0B;&#x51E0;&#x79CD;&#xFF1A;</p>
<ul>
<li>DNS&#x57DF;&#x540D;&#x89E3;&#x6790;&#x8D1F;&#x8F7D;&#x5747;&#x8861;;&#x5047;&#x8BBE;&#x6211;&#x4EEC;&#x7684;&#x57DF;&#x540D;&#x6307;&#x5411;&#x4E86;&#x591A;&#x4E2A;IP&#x5730;&#x5740;&#xFF0C;&#x5F53;&#x4E00;&#x4E2A;&#x57DF;&#x540D;&#x8BF7;&#x6C42;&#x6765;&#x65F6;&#xFF0C;DNS&#x670D;&#x52A1;&#x5668;&#x673A;&#x8FDB;&#x884C;&#x57DF;&#x540D;&#x89E3;&#x6790;&#x5C06;&#x57DF;&#x540D;&#x8F6C;&#x6362;&#x4E3A;IP&#x5730;&#x5740;&#x662F;&#xFF0C;&#x5728;1:N&#x7684;&#x6620;&#x5C04;&#x8F6C;&#x6362;&#x4E2D;&#x5B9E;&#x73B0;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x3002;DNS&#x670D;&#x52A1;&#x5668;&#x63D0;&#x4F9B;&#x7B80;&#x5355;&#x7684;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x7B97;&#x6CD5;&#xFF0C;&#x4F46;&#x5F53;&#x5176;&#x4E2D;&#x67D0;&#x53F0;&#x670D;&#x52A1;&#x5668;&#x51FA;&#x73B0;&#x6545;&#x969C;&#x65F6;&#xFF0C;&#x901A;&#x77E5;DNS&#x670D;&#x52A1;&#x5668;&#x79FB;&#x9664;&#x5F53;&#x524D;&#x6545;&#x969C;IP&#x3002;</li>
<li>&#x53CD;&#x5411;&#x4EE3;&#x7406;&#x8D1F;&#x8F7D;&#x5747;&#x8861;;&#x53CD;&#x5411;&#x4EE3;&#x7406;&#x53EA;&#x503C;&#x5BF9;&#x670D;&#x52A1;&#x5668;&#x7684;&#x4EE3;&#x7406;&#xFF0C;&#x4EE3;&#x7406;&#x670D;&#x52A1;&#x5668;&#x63A5;&#x53D7;&#x8BF7;&#x6C42;&#xFF0C;&#x901A;&#x8FC7;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x7B97;&#x6CD5;&#xFF0C;&#x5C06;&#x8BF7;&#x6C42;&#x8F6C;&#x53D1;&#x7ED9;&#x540E;&#x7AEF;&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x540E;&#x7AEF;&#x670D;&#x52A1;&#x8FD4;&#x56DE;&#x7ED9;&#x4EE3;&#x7406;&#x670D;&#x52A1;&#x5668;&#x7136;&#x540E;&#x4EE3;&#x7406;&#x670D;&#x52A1;&#x5668;&#x8FD4;&#x56DE;&#x5230;&#x5BA2;&#x6237;&#x7AEF;&#x3002;&#x53CD;&#x5411;&#x4EE3;&#x7406;&#x670D;&#x52A1;&#x5668;&#x7684;&#x4F18;&#x70B9;&#x662F;&#x9694;&#x79BB;&#x540E;&#x7AEF;&#x670D;&#x52A1;&#x5668;&#x548C;&#x5BA2;&#x6237;&#x7AEF;&#xFF0C;&#x4F7F;&#x7528;&#x53CC;&#x7F51;&#x5361;&#x5C4F;&#x853D;&#x771F;&#x5B9E;&#x670D;&#x52A1;&#x5668;&#x7F51;&#x7EDC;&#xFF0C;&#x5B89;&#x5168;&#x6027;&#x66F4;&#x597D;&#xFF0C;&#x76F8;&#x6BD4;&#x8F83;&#x4E8E;DNS&#x57DF;&#x540D;&#x89E3;&#x51B3;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#xFF0C;&#x53CD;&#x5411;&#x4EE3;&#x7406;&#x5728;&#x6545;&#x969C;&#x5904;&#x7406;&#x65B9;&#x9762;&#x66F4;&#x7075;&#x6D3B;&#xFF0C;&#x652F;&#x6301;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x7B97;&#x6CD5;&#x7684;&#x6A2A;&#x5411;&#x6269;&#x5C55;&#x3002;&#x76EE;&#x524D;&#x4F7F;&#x7528;&#x975E;&#x5E38;&#x5E7F;&#x6CDB;&#x3002;&#x5F53;&#x7136;&#x53CD;&#x5411;&#x4EE3;&#x7406;&#x4E5F;&#x9700;&#x8981;&#x8003;&#x8651;&#x5F88;&#x591A;&#x95EE;&#x9898;&#xFF0C;&#x6BD4;&#x5982;&#x5355;&#x70B9;&#x6545;&#x969C;&#xFF0C;&#x96C6;&#x7FA4;&#x90E8;&#x7F72;&#x7B49;&#x3002;</li>
<li>IP&#x8D1F;&#x8F7D;&#x5747;&#x8861;;&#x6211;&#x4EEC;&#x90FD;&#x77E5;&#x9053;&#x53CD;&#x5411;&#x4EE3;&#x7406;&#x5DE5;&#x4F5C;&#x5230;HTTP&#x5C42;&#xFF0C;&#x672C;&#x8EAB;&#x5F00;&#x9500;&#x76F8;&#x5BF9;&#x5927;&#x4E00;&#x4E9B;&#xFF0C;&#x5BF9;&#x6027;&#x80FD;&#x6709;&#x4E00;&#x5B9A;&#x5F71;&#x54CD;&#xFF0C;LVS-NAT&#x662F;&#x4E00;&#x79CD;&#x536B;&#x6D74;&#x4F20;&#x8F93;&#x5C42;&#x7684;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#xFF0C;&#x5B83;&#x901A;&#x8FC7;&#x4FEE;&#x6539;&#x63A5;&#x53D7;&#x7684;&#x6570;&#x636E;&#x5305;&#x76EE;&#x6807;&#x5730;&#x5740;&#x7684;&#x65B9;&#x5F0F;&#x5B9E;&#x73B0;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x3002;Linux2.6.x&#x4EE5;&#x540E;&#x7248;&#x672C;&#x5185;&#x7F6E;&#x4E86;IPVS&#xFF0C;&#x4E13;&#x6CE8;&#x7528;&#x4E8E;&#x5B9E;&#x73B0;IP&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#xFF0C;&#x6545;&#x800C;&#x5728;Linux&#x4E0A;IP&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x4F7F;&#x7528;&#x975E;&#x5E38;&#x5E7F;&#x6CDB;&#x3002;LVS-DR&#x5DE5;&#x4F5C;&#x5728;&#x6570;&#x636E;&#x94FE;&#x8DEF;&#x5C42;&#xFF0C;&#x6BD4;LVS-NAT&#x66F4;&#x9738;&#x9053;&#x7684;&#x65F6;&#x5019;&#x5B83;&#x76F4;&#x63A5;&#x4FEE;&#x6539;&#x6570;&#x636E;&#x5305;&#x7684;MAC&#x5730;&#x5740;&#x3002;LVS-TUN&#x2014;&#x2014;&#x57FA;&#x4E8E;IP&#x96A7;&#x9053;&#x7684;&#x8BF7;&#x6C42;&#x8F6C;&#x53D1;&#x673A;&#x5236;&#xFF0C;&#x5C06;&#x8C03;&#x5EA6;&#x5668;&#x6536;&#x5230;&#x7684;IP&#x6570;&#x636E;&#x5305;&#x8FDB;&#x884C;&#x5C01;&#x88C5;&#xFF0C;&#x8F6C;&#x4EA4;&#x7ED9;&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x7136;&#x540E;&#x670D;&#x52A1;&#x5668;&#x8FD4;&#x56DE;&#x6570;&#x636E;&#xFF0C;&#x901A;&#x8FC7;&#x8C03;&#x5EA6;&#x5668;&#x5B9E;&#x73B0;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x3002;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x652F;&#x6301;&#x8DE8;&#x7F51;&#x6BB5;&#x8C03;&#x5EA6;&#x3002;&#x603B;&#x7ED3;&#x4E00;&#x4E0B;&#xFF0C;LVS-DR&#x548C;LVS-TUN&#x90FD;&#x9002;&#x5408;&#x54CD;&#x5E94;&#x548C;&#x8BF7;&#x6C42;&#x4E0D;&#x5BF9;&#x79F0;&#x7684;Web&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x5982;&#x4F55;&#x4ECE;&#x5B83;&#x4EEC;&#x4E2D;&#x505A;&#x51FA;&#x9009;&#x62E9;&#xFF0C;&#x53D6;&#x51B3;&#x4E8E;&#x4F60;&#x7684;&#x7F51;&#x7EDC;&#x90E8;&#x7F72;&#x9700;&#x8981;&#xFF0C;&#x56E0;&#x4E3A;LVS-TUN&#x53EF;&#x5177;&#x6709;&#x8DE8;&#x5730;&#x57DF;&#x6027;&#xFF0C;&#x6709;&#x7C7B;&#x4F3C;&#x8FD9;&#x79CD;&#x9700;&#x6C42;&#x7684;&#xFF0C;&#x5C31;&#x5E94;&#x8BE5;&#x9009;&#x62E9;LVS-TUN&#x3002;</li>
</ul>
<h3 id="&#x5BA2;&#x6237;&#x7AEF;">&#x5BA2;&#x6237;&#x7AEF;</h3>
<p>&#x5BA2;&#x6237;&#x7AEF;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x4E0E;&#x670D;&#x52A1;&#x7AEF;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x6700;&#x5927;&#x7684;&#x4E0D;&#x540C;&#x70B9;&#x5728;&#x4E8E;<strong>&#x670D;&#x52A1;&#x6E05;&#x5355;&#x6240;&#x5728;&#x5B58;&#x50A8;&#x4F4D;&#x7F6E;</strong>&#x3002;</p>
<p>&#x800C;&#x5BA2;&#x6237;&#x7AEF;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x4E2D;&#xFF0C;<strong>&#x6240;&#x6709;&#x5BA2;&#x6237;&#x7AEF;&#x8282;&#x70B9;&#x90FD;&#x8981;&#x7EF4;&#x62A4;&#x8FD9;&#x81EA;&#x5DF1;&#x8981;&#x8BBF;&#x95EE;&#x7684;&#x670D;&#x52A1;&#x7AEF;&#x6E05;&#x5355;</strong>&#x3002;</p>
<p>&#x4E3A;&#x4E86;&#x8FBE;&#x5230;&#x76EE;&#x6807;&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x9700;&#x8981;&#x5F15;&#x5165;&#x670D;&#x52A1;&#x6CE8;&#x518C;&#x4E2D;&#x5FC3;&#x914D;&#x5408;&#x5B8C;&#x6210;</p>
<h2 id="dns&#x89E3;&#x6790;&#x5C42;">DNS&#x89E3;&#x6790;&#x5C42;</h2>
<p><img src="http://www.plantuml.com/plantuml/proxy?src=https://raw.github.com/plantuml/plantuml-server/master/src/main/webapp/resource/test2diagrams.txt" alt="sdfd"></p>
<p><img src="assets/1585712478753.png" alt="1585712478753"></p>
<p>DNS&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x7279;&#x70B9;</p>
<ul>
<li>&#x7B80;&#x5355;&#x7B97;&#x6CD5;</li>
<li>&#x65E0;&#x6CD5;&#x611F;&#x77E5;&#x6307;&#x5411;&#x670D;&#x52A1;&#x72B6;&#x6001;&#xFF0C;&#x5373;&#x4F7F;&#x8282;&#x70B9;&#x65E0;&#x6548;&#x4F9D;&#x7136;&#x53D1;&#x51FA;&#x8BF7;&#x6C42;</li>
</ul>
<h2 id="nginx&#x53CD;&#x5411;&#x4EE3;&#x7406;&#x5C42;">Nginx&#x53CD;&#x5411;&#x4EE3;&#x7406;&#x5C42;</h2>
<p>Nginx&#x96C6;&#x7FA4;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x901A;&#x8FC7;LVS&#x5747;&#x8861;&#x5668;&#x5B9E;&#x73B0;&#x8D1F;&#x8F7D;</p>
<p>&#x901A;&#x8FC7;Keepalived&#x5B9E;&#x73B0;&#x9AD8;&#x53EF;&#x7528;</p>
<p><img src="assets/1585717020031.png" alt="1585717020031"></p>
<p>&#x4E3B;&#x4ECE;&#x6A21;&#x5F0F;&#x5DE5;&#x4F5C;&#x539F;&#x7406;</p>
<ul>
<li>Keepalived&#x57FA;&#x7840;&#x662F;VRRP&#x534F;&#x8BAE;&#xFF0C;&#x5373;&#x865A;&#x62DF;IP&#xFF0C;&#x8BE6;&#x7EC6;&#x53C2;&#x8003;<a href="https://blog.51cto.com/8341475/2162366" target="_blank">VRRP&#x534F;&#x8BAE;</a></li>
<li>VRRP&#x534F;&#x8BAE;&#x6A21;&#x62DF;&#x8DEF;&#x7531;&#x5668;&#xFF0C;&#x591A;&#x53F0;&#x673A;&#x5668;&#x7EC4;&#x6210;&#x4E00;&#x4E2A;&#x8DEF;&#x7531;&#x5668;&#xFF0C;&#x8DEF;&#x7531;&#x5668;&#x5BF9;&#x5916;&#x63D0;&#x4F9B;&#x552F;&#x4E00;&#x4E00;&#x4E2A;&#x8BBF;&#x95EE;IP</li>
<li>VPPR&#x4E0D;&#x505A;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#xFF0C;&#x4E0B;&#x6E38;&#x4E3B;&#x8282;&#x70B9;&#x63A5;&#x6536;&#x8BF7;&#x6C42;&#xFF0C;&#x4ECE;&#x8282;&#x70B9;&#x63A5;&#x6536;VPPR&#x6570;&#x636E;&#xFF0C;&#x4F46;&#x4E0D;&#x5904;&#x7406;</li>
<li>Keepalived&#x901A;&#x8FC7;&#x5FC3;&#x8DF3;&#x673A;&#x5236;&#xFF0C;&#x68C0;&#x67E5;Nginx&#x5065;&#x5EB7;&#x72B6;&#x51B5;&#xFF0C;&#x5F53;&#x7BA1;&#x5C5E;&#x7684;Nginx&#x8282;&#x70B9;&#x4E0D;&#x53EF;&#x7528;&#xFF0C;&#x5219;&#x6267;&#x884C;&#x91CD;&#x542F;&#x811A;&#x672C;&#xFF0C;&#x5E76;&#x91CD;&#x65B0;&#x9009;&#x4E3E;Keepalived&#x4E3B;&#x8282;&#x70B9;</li>
</ul>
<p>&#x4E3B;&#x4ECE;&#x6A21;&#x5F0F;&#x7F3A;&#x70B9;</p>
<ul>
<li>&#x5B9E;&#x9645;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;Nginx&#x96C6;&#x7FA4;&#x6CA1;&#x6709;&#x6548;&#x679C;&#xFF0C;&#x53EA;&#x6709;1&#x4E2A;&#x8282;&#x70B9;&#x8FD0;&#x4F5C;</li>
<li>&#x8D44;&#x6E90;&#x8017;&#x8D39;&#xFF0C;&#x5EFA;&#x8BAE;&#x91C7;&#x7528;&#x53CC;&#x4E3B;&#x6A21;&#x5F0F;</li>
</ul>
<p>&#x53CC;&#x4E3B;&#x6A21;&#x5F0F;&#x5DE5;&#x4F5C;&#x539F;&#x7406;</p>
<ul>
<li>&#x5728;&#x4E3B;&#x4ECE;&#x6A21;&#x5F0F;&#x673A;&#x5236;&#x4E0A;&#xFF0C;&#x914D;&#x7F6E;&#x6210;&#x4E92;&#x4E3A;&#x4E3B;&#x4ECE;</li>
<li>&#x63D0;&#x4F9B;&#x591A;&#x4E2A;VIP&#x5730;&#x5740;&#xFF0C;&#x4E0A;&#x6E38;&#x518D;&#x901A;&#x8FC7;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x5668;&#x5B9E;&#x73B0;&#xFF0C;&#x8DEF;&#x7531;&#x5230;&#x4E0D;&#x540C;VIP&#x5730;&#x5740;</li>
<li>&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x5668;&#x53EF;&#x4EE5;&#x91C7;&#x7528;LVS&#x3001;HAproxy&#x7B49;</li>
</ul>
<h2 id="redis&#x96C6;&#x7FA4;">Redis&#x96C6;&#x7FA4;</h2>
<p>Redis Cluster&#x96C6;&#x7FA4;&#x5185;&#x5EFA;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x65B9;&#x6848;</p>
<ol>
<li>Redis-Cluster&#x91C7;&#x7528;&#x65E0;&#x4E2D;&#x5FC3;&#x7ED3;&#x6784;&#xFF0C;<strong>&#x6BCF;&#x4E2A;&#x8282;&#x70B9;&#x4FDD;&#x5B58;&#x6570;&#x636E;&#x548C;&#x6574;&#x4E2A;&#x96C6;&#x7FA4;&#x72B6;&#x6001;</strong>,&#x6BCF;&#x4E2A;&#x8282;&#x70B9;&#x90FD;&#x548C;&#x5176;&#x4ED6;&#x6240;&#x6709;&#x8282;&#x70B9;&#x8FDE;&#x63A5;&#x3002;</li>
<li>&#x6240;&#x6709;&#x7684;redis&#x8282;&#x70B9;&#x5F7C;&#x6B64;&#x4E92;&#x8054;(PING-PONG&#x673A;&#x5236;),&#x5185;&#x90E8;&#x4F7F;&#x7528;&#x4E8C;&#x8FDB;&#x5236;&#x534F;&#x8BAE;&#x4F18;&#x5316;&#x4F20;&#x8F93;&#x901F;&#x5EA6;&#x548C;&#x5E26;&#x5BBD;&#x3002;</li>
<li>&#x8282;&#x70B9;&#x7684;fail&#x662F;&#x901A;&#x8FC7;&#x96C6;&#x7FA4;&#x4E2D;&#x8D85;&#x8FC7;&#x534A;&#x6570;&#x7684;&#x8282;&#x70B9;&#x68C0;&#x6D4B;&#x5931;&#x6548;&#x65F6;&#x624D;&#x751F;&#x6548;&#x3002;</li>
<li>&#x5BA2;&#x6237;&#x7AEF;&#x4E0E;redis&#x8282;&#x70B9;&#x76F4;&#x8FDE;,&#x4E0D;&#x9700;&#x8981;&#x4E2D;&#x95F4;proxy&#x5C42;.&#x5BA2;&#x6237;&#x7AEF;&#x4E0D;&#x9700;&#x8981;&#x8FDE;&#x63A5;&#x96C6;&#x7FA4;&#x6240;&#x6709;&#x8282;&#x70B9;,&#x8FDE;&#x63A5;&#x96C6;&#x7FA4;&#x4E2D;&#x4EFB;&#x4F55;&#x4E00;&#x4E2A;&#x53EF;&#x7528;&#x8282;&#x70B9;&#x5373;&#x53EF;&#x3002;</li>
</ol>
<p>&#x53C2;&#x8003;&#xFF1A;<a href="../Redis/Redis.html#&#x9AD8;&#x53EF;&#x7528;">Redis&#x9AD8;&#x53EF;&#x7528;</a></p>
<h2 id="rabbitmq&#x6D88;&#x606F;&#x4E2D;&#x95F4;&#x4EF6;">Rabbitmq&#x6D88;&#x606F;&#x4E2D;&#x95F4;&#x4EF6;</h2>
<p>&#x4E0E;Nginx&#x81EA;&#x8EAB;&#x7684;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x65B9;&#x6848;&#x4E00;&#x76F4;</p>
<p>&#x91C7;&#x7528;Keepalived + HAproxy&#x5B9E;&#x73B0;&#x9AD8;&#x53EF;&#x7528;&#x53CA;&#x8D1F;&#x8F7D;&#x5747;&#x8861;</p>
<p><a href="../MQ/RabbitMQ&#x7B14;&#x8BB0;.html#&#x8D1F;&#x8F7D;&#x5747;&#x8861;">Rabbitmq&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x7B56;&#x7565;</a></p>
<h2 id="zuul&#x7F51;&#x5173;&#x5C42;">Zuul&#x7F51;&#x5173;&#x5C42;</h2>
<p>&#x91C7;&#x7528;Nginx&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x7B56;&#x7565;</p>
<p><a href="../&#x8FD0;&#x7EF4;/Nginx&#x8D1F;&#x8F7D;&#x5747;&#x8861;.html">Nginx&#x8D1F;&#x8F7D;&#x5747;&#x8861;</a></p>
<h2 id="service&#x670D;&#x52A1;&#x5C42;">Service&#x670D;&#x52A1;&#x5C42;</h2>
<p>&#x91C7;&#x7528;Ribbon + Eureka&#x5BA2;&#x6237;&#x7AEF;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x7B56;&#x7565;</p>
<h3 id="eureka&#x670D;&#x52A1;&#x6CBB;&#x7406;">Eureka&#x670D;&#x52A1;&#x6CBB;&#x7406;</h3>
<p>Eureka&#x670D;&#x52A1;&#x6CBB;&#x7406;&#x67B6;&#x6784;&#x56FE;</p>
<p><img src="assets/1574657946016.png" alt="1574657946016"></p>
<h3 id="ribbon&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x5668;">Ribbon&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x5668;</h3>
<h3 id="ribbon&#x4E0E;feign&#x533A;&#x522B;">ribbon&#x4E0E;feign&#x533A;&#x522B;</h3>
<p>Feign&#x662F;Netflix&#x5F00;&#x53D1;&#x57FA;&#x4E8E;ribbon&#x5B9E;&#x73B0;&#x7684;<strong>&#x58F0;&#x660E;&#x5F0F;</strong>&#x3001;&#x8D1F;&#x8F7D;&#x5747;&#x8861;HTTP&#x5BA2;&#x6237;&#x7AEF;</p>
<p>Spring Cloud&#x5BF9;Feign&#x8FDB;&#x884C;&#x4E86;&#x589E;&#x5F3A;&#xFF0C;&#x4F7F;Feign&#x652F;&#x6301;&#x4E86;Spring MVC&#x6CE8;&#x89E3;&#xFF0C;&#x5E76;&#x6574;&#x5408;&#x4E86;Ribbon&#x548C;Eureka&#xFF0C;&#x4ECE;&#x800C;&#x8BA9;Feign&#x7684;&#x4F7F;&#x7528;&#x66F4;&#x52A0;&#x65B9;&#x4FBF;&#x3002;</p>
<p>&#x8BE6;&#xFF1A;<a href="Feign.html">HTTP&#x5BA2;&#x6237;&#x7AEF;Feign</a></p>
<h3 id="&#x7B56;&#x7565;">&#x7B56;&#x7565;</h3>
<p><img src="assets/1574673696658.png" alt="1574673696658"></p>
<ul>
<li>RandomRule&#x968F;&#x673A;</li>
<li>WeightedResponseTimeRule&#x52A0;&#x6743;</li>
<li>BestAvailableRule&#x6700;&#x5C11;&#x8BF7;&#x6C42;&#x6570;</li>
<li>RoundRobinRule&#x8F6E;&#x8BE2;</li>
</ul>
<p><img src="assets/1574673675181.png" alt="1574673675181"></p>
<p>TODO&#xFF1A;&#x9ED8;&#x8BA4;&#x7B56;&#x7565;&#x53CA;&#x539F;&#x7406;</p>
<h3 id="resttemplate--ribbon&#x793A;&#x4F8B;&#x4EE3;&#x7801;">RestTemplate + Ribbon&#x793A;&#x4F8B;&#x4EE3;&#x7801;</h3>
<pre><code class="lang-java"><span class="hljs-meta">@SpringBootApplication</span>
<span class="hljs-meta">@EnableDiscoveryClient</span>
<span class="hljs-meta">@RestController</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">RibbonClient</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
        SpringApplication.run(RibbonClient.class, args);
    }

    <span class="hljs-meta">@Bean</span>
    <span class="hljs-meta">@LoadBalanced</span> <span class="hljs-comment">//&#x5B9E;&#x73B0;&#x8D1F;&#x8F7D;&#x5747;&#x8861;</span>
    <span class="hljs-function">RestTemplate <span class="hljs-title">restTemplate</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> RestTemplate();
    }

    <span class="hljs-meta">@Autowired</span>
    <span class="hljs-keyword">private</span> RestTemplate restTemplate;

    <span class="hljs-meta">@GetMapping</span>(<span class="hljs-string">&quot;/ribbonInvoke&quot;</span>)
    <span class="hljs-function"><span class="hljs-keyword">private</span> String <span class="hljs-title">ribbonInvoke</span><span class="hljs-params">()</span> </span>{
        RibbonMessage msg = restTemplate.getForObject(<span class="hljs-string">&quot;http://TG-RIBBON-SERVICE/ribbonAccept&quot;</span>, RibbonMessage.class);
        System.out.println(msg);

        <span class="hljs-keyword">return</span> msg.toString();
    }
}
</code></pre>
<h3 id="&#x91CD;&#x8BD5;&#x673A;&#x5236;">&#x91CD;&#x8BD5;&#x673A;&#x5236;</h3>
<p><img src="assets/1574677793047.png" alt="1574677793047"></p>
<p>&#x793A;&#x4F8B;</p>
<p><img src="assets/1574677826676.png" alt="1574677826676"></p>
<p><img src="assets/1574677857638.png" alt="1574677857638"></p>
<p>&#x5F53;&#x8BF7;&#x6C42;&#x5230;&#x6545;&#x969C;&#x8282;&#x70B9;&#xFF0C;ribbon&#x4F1A;&#x518D;&#x5C1D;&#x8BD5;&#x8BBF;&#x95EE;&#x4E00;&#x6B21;&#x5F53;&#x524D;&#x5B9E;&#x4F8B;&#xFF08;&#x6B21;&#x6570;&#x7531;MaxAutoRetries&#x914D;&#x7F6E;&#xFF09;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x5E78;&#xFF0C;&#x5C31;&#x6362;&#x4E00;&#x4E2A;&#x5B9E;&#x4F8B;&#x8FDB;&#x884C;&#x8BBF;&#x95EE;&#xFF0C;&#x5982;&#x679C;&#x8FD8;&#x662F;&#x4E0D;&#x5E78;&#xFF0C;&#x518D;&#x6362;&#x4E00;&#x4E2A;&#x5B9E;&#x4F8B;&#x8BBF;&#x95EE;&#xFF08;&#x66F4;&#x6362;&#x6B21;&#x6570;&#x7531;MaxAutoRetriesNextServer&#x914D;&#x7F6E;&#xFF09;&#xFF0C;&#x5982;&#x679C;&#x4F9D;&#x7136;&#x4E0D;&#x884C;&#xFF0C;&#x8FD4;&#x56DE;&#x5931;&#x8D25;&#x4FE1;&#x606F;</p>
<h3 id="&#x5E38;&#x7528;&#x914D;&#x7F6E;">&#x5E38;&#x7528;&#x914D;&#x7F6E;</h3>
<p>&#x5F53;&#x7F3A;&#x5C11;&#x670D;&#x52A1;&#x6CBB;&#x7597;&#x6846;&#x67B6;&#x65F6;&#xFF0C;&#x9700;&#x8981;&#x6307;&#x5B9A;&#x5177;&#x4F53;&#x5B9E;&#x4F8B;&#x6E05;&#x5355;</p>
<pre><code class="lang-properties">hello-service.ribbon.listOfServers=localhost:8001,localhost:8002,localhost:8003
</code></pre>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; tgor.top 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2020-04-23 15:32:53
</span></footer>
<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../运维/Nginx限流.html" class="navigation navigation-prev " aria-label="Previous page: 限流Nginx">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../运维/Nginx负载均衡.html" class="navigation navigation-next " aria-label="Next page: 负载均衡Nginx">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"负载均衡","level":"1.2.4","depth":2,"next":{"title":"负载均衡Nginx","level":"1.2.5","depth":2,"path":"运维/Nginx负载均衡.md","ref":"运维/Nginx负载均衡.md","articles":[]},"previous":{"title":"限流Nginx","level":"1.2.3","depth":2,"path":"运维/Nginx限流.md","ref":"运维/Nginx限流.md","articles":[]},"dir":"ltr"},"config":{"plugins":["chapter-fold","splitter","tbfed-pagefooter","page-toc-button","-search","search-pro","popup","back-to-top-button","code","copy-code-button"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy tgor.top 2019","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"splitter":{},"search-pro":{"cutWordLib":"nodejieba","defineWord":["Gitbook Use"]},"popup":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"code":{"copyButtons":true},"fontsettings":{"theme":"sepia","family":"serif","size":1},"highlight":{},"page-toc-button":{"maxTocDepth":2,"minTocSize":2},"back-to-top-button":{},"copy-code-button":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"tgor","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"tgor note","gitbook":"*","description":"tgor生活工作记录"},"file":{"path":"Java-Spring/负载均衡.md","mtime":"2020-04-23T07:32:53.311Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-04-29T08:43:24.127Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

